/**
 * <p>Copyright (c) 2017 深圳市鹏途交通科技有限公司 </p>
 * <p>		    All right reserved. 		     </p>
 * <p>项目名称 ： 	 深圳公路信息资源整合及国省检日常化监管管理        </p>
 * <p>创建者   :	詹春贤 
 * <p>描   述  :   路网服务-应急抢修  </p>
 * <p>最后修改 : $: 2017年8月30日-下午4:01:48 v 1.0.0	 Administrator   $ </p>
 * 
*/

package com.pengtu.gsj.entity.lwfw;

import java.util.List;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.pengtu.gsj.entity.app.Attachment;
import com.pengtu.gsj.entity.base.IdEntity;

/**
 * 
 * EmergRepair
 * 
 * 2017年8月30日 下午4:01:48
 * 
 * @version 1.0.0
 * 
 */

@Entity
@Table(name = "T_LWFW_EMERGREPAIR")
public class EmergRepair extends IdEntity{

	/**
	 * serialVersionUID:TODO
	 *
	 * @since 1.0.0
	 */
	
	private static final long serialVersionUID = 6347989367562861814L;
	
	private String year;	//年份
	private Double reportNum;	//上报数量
	private Double restoreNum; //恢复数量
	private Double ratio;	//比例
	private String remark;	//备注
	
	private Integer bulletinNumber;     //检测文件数
	private List<Attachment> attachments;
	
	//声明空参构造方法
	public EmergRepair() {
		super();
	}

	
	/**
	 * EmergRepair.
	 * 适用：emergRepairDao中查询数据专用构造器
	 * @param reportNum
	 * @param restoreNum
	 * @param ratio
	 */
	public EmergRepair(String year, Double reportNum, Double restoreNum, Double ratio) {
		this.year = year;
		this.reportNum = reportNum;
		this.restoreNum = restoreNum;
		this.ratio = ratio;
	}

	
	@Column(name = "YEAR")
	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	
	@Column(name = "REPORTNUM")
	public Double getReportNum() {
		return reportNum;
	}

	public void setReportNum(Double reportNum) {
		this.reportNum = reportNum;
	}

	
	@Column(name = "RESTORENUM")
	public Double getRestoreNum() {
		return restoreNum;
	}

	public void setRestoreNum(Double restoreNum) {
		this.restoreNum = restoreNum;
	}

	
	@Column(name = "RATIO")
	public Double getRatio() {
		return ratio;
	}

	public void setRatio(Double ratio) {
		this.ratio = ratio;
	}
	
	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}


	@Transient
	public Integer getBulletinNumber() {
		bulletinNumber = attachments.size();
		return bulletinNumber;
	}

	public void setBulletinNumber(Integer bulletinNumber) {
		this.bulletinNumber = bulletinNumber;
	}

	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARTID")
	public List<Attachment> getAttachments() {
		return attachments;
	}

	public void setAttachments(List<Attachment> attachments) {
		this.attachments = attachments;
	}
}
